package ysq.xyg.web.model.po;

import lombok.NoArgsConstructor;

import lombok.Data;
import ysq.xyg.base.util.BaseConstant;
import ysq.xyg.base.util.BaseUtil;
import ysq.xyg.sys.model.po.SysUser;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * 业务模块-通用地址实体类
 *
 * @author congcong tao
 * @date 2019-5-14 14:23:39
 */
@Data
@NoArgsConstructor
@Table(name = "xyg_web_address")
public class WebAddress implements Serializable{

	/**
     * 主键
     */ 
	@Id
	private String id;
	/**
     * 省
     */ 
	@Column(name = "province")
	private String province;
	/**
     * 市
     */ 
	@Column(name = "city")
	private String city;
	/**
     * 首字母
     */ 
	@Column(name = "letter")
	private String letter;

	/**
	 * 区
	 */
	@Column(name = "area")
	private String area;

	/**
     * 详细地址
     */ 
	@Column(name = "descripts")
	private String descripts;
	/**
     * 是否默认地址：1、是，2、否
     */ 
	@Column(name = "type")
	private String type;
	/**
     * 排序
     */ 
	@Column(name = "orderNum")
	private String orderNum;
	/**
     * 创建者
     */ 
	@Column(name = "create_user")
	private String createUser;
	/**
     * 创建时间
     */ 
	@Column(name = "create_time")
	private Date createTime;
	/**
     * 删除状态1、未删除2、已删除
     */ 
	@Column(name = "remove_tag")
	private String removeTag;
	/**
     * 更新者
     */ 
	@Column(name = "update_user")
	private String updateUser;
	/**
     * 更新时间
     */ 
	@Column(name = "update_time")
	private Date updateTime;

	public WebAddress(SysUser sysUser) {
		this.id= BaseUtil.uId();
		this.removeTag= BaseConstant.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.createUser = sysUser.getId();
		this.updateTime = new Date();
		this.updateUser = sysUser.getId();
	}
}